#ifndef _DLL_H_
#define _DLL_H_
#include <sys/types.h>
#include <string>
#include "connect_info.h"

typedef int     (*handle_init_t)          (int, char **);
typedef int     (*handle_input_t)         (const char *, int , ConnectInfo* , int*);
typedef int     (*handle_process_t)       (const char *, int , ConnectInfo* );
typedef int     (*handle_open_t)          (const ConnectInfo*);
typedef int     (*handle_close_t)         (const ConnectInfo*);
typedef void    (*handle_fini_t)          (void);
typedef int     (*handle_input_buf_t)     (const char *, int , ConnectInfo* );
typedef int     (*handle_output_t)        (const char *, int , ConnectInfo*);
typedef int     (*handle_output_buf_t)    (const char *, int , ConnectInfo* );
typedef int     (*handle_proxy_ip_t)      (ConnectInfo* , std::string* , int* );
typedef int     (*handle_proxy_open_t)    (ConnectInfo* );

typedef struct  dll_func_struct { 
	void *handle;
    handle_init_t       handle_init;
	handle_input_t      handle_input;
	handle_process_t    handle_process;
    handle_open_t       handle_open;
    handle_close_t      handle_close;
	handle_fini_t       handle_fini;
    handle_input_buf_t  handle_input_buf;
    handle_output_t     handle_output;
    handle_output_buf_t handle_output_buf;
    handle_proxy_ip_t   handle_proxy_ip;
    handle_proxy_open_t handle_proxy_open;
}   dll_func_t;

extern dll_func_t dll;

extern int register_plugin (const char *file_name);
extern void unregister_plugin ();
#endif
